Stata:OLS与WLS的差异检验 您所在的位置:网站首页 stata的drop if Stata:OLS与WLS的差异检验

Stata:OLS与WLS的差异检验

2022-10-09 04:03| 来源: 网络整理| 查看: 265

. keep if clone==0. program bs_wls_ols, eclass 1. reg lnwage educ exper tenure female age agesq 2. matrix b1=e(b) 3. capture drop lres 4. predictnl lres=log((lnwage-xb())^2) 5. reg lres educ exper tenure female age agesq 6. capture drop nwgt 7. predictnl nwgt=1/exp(xb()) 8. ** two steps assuming Weights change. reg lnwage educ exper tenure female age agesq [w=nwgt] 9. matrix b2=e(b) 10. ** two steps assuming Weights do not change. reg lnwage educ exper tenure female age agesq [w=1/h_x] 11. matrix b3=e(b) 12. ** Finally the differences. matrix db2=b1-b2 13. matrix db3=b1-b3 14. ** putting all together:. matrix coleq b2= wols_dw 15. matrix coleq b3= wols_fw 16. matrix coleq db2= dwols_dw 17. matrix coleq db3= dwols_fw 18. matrix b=b2,b3,db2,db3 19. ereturn post b 20. end

. bootstrap, reps(500) seed(10) nodots: bs_wls_ols

Bootstrap results Number of obs = 1,434 Replications = 500------------------------------------------------------------------------------ | Observed Bootstrap Normal-based | coefficient std. err. z P>|z| [95% conf. interval]-------------+----------------------------------------------------------------wols_dw | educ | 0.056 0.005 10.63 0.000 0.045 0.066 exper | -0.001 0.002 -0.88 0.379 -0.005 0.002 tenure | 0.003 0.002 2.05 0.040 0.000 0.006 female | -0.154 0.025 -6.16 0.000 -0.203 -0.105 age | 0.098 0.008 12.69 0.000 0.083 0.113 agesq | -0.001 0.000 -11.12 0.000 -0.001 -0.001 _cons | 0.719 0.142 5.07 0.000 0.441 0.997-------------+----------------------------------------------------------------wols_fw | educ | 0.056 0.005 11.24 0.000 0.046 0.066 exper | -0.001 0.002 -0.94 0.346 -0.005 0.002 tenure | 0.003 0.002 2.06 0.040 0.000 0.006 female | -0.154 0.022 -6.97 0.000 -0.197 -0.110 age | 0.098 0.008 11.58 0.000 0.081 0.114 agesq | -0.001 0.000 -10.44 0.000 -0.001 -0.001 _cons | 0.719 0.163 4.42 0.000 0.400 1.037-------------+----------------------------------------------------------------dwols_dw | educ | 0.008 0.004 2.02 0.044 0.000 0.015 exper | 0.001 0.001 1.07 0.286 -0.001 0.004 tenure | 0.003 0.001 2.51 0.012 0.001 0.005 female | 0.003 0.013 0.22 0.828 -0.023 0.028 age | 0.014 0.008 1.79 0.074 -0.001 0.030 agesq | -0.000 0.000 -1.89 0.059 -0.000 0.000 _cons | -0.386 0.163 -2.36 0.018 -0.706 -0.065-------------+----------------------------------------------------------------dwols_fw | educ | 0.008 0.003 2.48 0.013 0.002 0.013 exper | 0.001 0.001 1.14 0.254 -0.001 0.003 tenure | 0.003 0.001 2.92 0.003 0.001 0.005 female | 0.003 0.011 0.25 0.799 -0.019 0.025 age | 0.014 0.005 2.69 0.007 0.004 0.025 agesq | -0.000 0.000 -2.75 0.006 -0.000 -0.000 _cons | -0.386 0.103 -3.73 0.000 -0.588 -0.183------------------------------------------------------------------------------



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有